﻿using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web.Mvc;
using InnovaApp.Layers.MetaDataLayer;
using INNOVACALL.Framework.Common.MVCHelpers.Localization;

namespace InnovaApp.Portals.MVC4Portal.Models.MetaModels.ContactManagement
{
    public class ContactAddress_MetaModel : ContactAddress_MetaData
    {
        [DisplayNameLocalizedEntityAttribute(typeof(InnovaApp.Layers.ResourcesLayer.Properties.Resources), "ContactAddress", "IsPostAddress")]
        public bool IsPostAddress { get; set; }
        [DisplayNameLocalizedEntityAttribute(typeof(InnovaApp.Layers.ResourcesLayer.Properties.Resources), "ContactAddress", "IsDeliveryAddress")]
        public bool IsDeliveryAddress { get; set; }
        [DisplayNameLocalizedEntityAttribute(typeof(InnovaApp.Layers.ResourcesLayer.Properties.Resources), "ContactAddress", "IsInvoicingAddress")]
        public bool IsInvoicingAddress { get; set; }

        /// <summary>
        /// Get country list from CulturInfo
        /// </summary>
        public List<SelectListItem> Countries
        {
            get
            {
                List<SelectListItem> toReturn;
                toReturn = CultureInfo.GetCultures(CultureTypes.AllCultures & ~CultureTypes.NeutralCultures).Select(c => new SelectListItem
                {
                    Text = c.EnglishName,
                    Value = c.DisplayName
                }).ToList();
                return toReturn;
            }
        }
    }
}